var dataOne = [],
    dataOneCode = [],//饼图code
    carousel = '',
    dataYear = [],//折线图年份选择
    dataCase = ['5','6','7','8','9'],//折线图案件类型选择
    dataCaseEight = [],//8类案件
    dataCaseFlag = false,//八类案件是否选中
    tips = '',//tips索引
    firstGet = 1,//第一次请求填充图片
    firstCircle = 1,//第一次请求饼图
    firstOrder = 1,//第一次指令
    firstCircleLoading = 1,//取消饼图与折线关联
    defaultTime = 3,//默认加载年数据
    newsTime = null,//新闻轮播
    initial = 0,//初始滚动位置
    circleBeginTime = '',//饼图开始时间
    circleEndTime = '',//饼图结束时间
    obj =  {
        value_1:[],
        value_2:[],
        name:[],
        labelFromatter:[],
        orgCode: []
    },
    obj_2 = {  //月
        x: Array(12),
        case_5: [],
        case_6: [],
        case_7: [],
        case_8: [],
        case_9: [],
        case_10: [],
        case_11: [],
        case_12: [],
        case_13: [],
        case_14: [],
        case_15: [],
        case_16: []
    },
    obj_2_week = {  //周
        x: ['周日','周一','周二','周三','周四','周五','周六'],
        case_5: [],
        case_6: [],
        case_7: [],
        case_8: [],
        case_9: [],
        case_10: [],
        case_11: [],
        case_12: [],
        case_13: [],
        case_14: [],
        case_15: [],
        case_16: []
    },
    obj_2_year = {
        x: [],
        case_5: [],
        case_6: [],
        case_7: [],
        case_8: [],
        case_9: [],
        case_10: [],
        case_11: [],
        case_12: [],
        case_13: [],
        case_14: [],
        case_15: [],
        case_16: []
    },
    obj_3 = {
        name:[],
        data_3_Clue:[],
        no_Num: [],
        data_3_Case:[]
    },
    obj_5 = {
        dataName:[],
        dataValue:[]
    },
    // obj_6={
    //     data1:[{'color':'#cae852','y':0},{'color':'#cae852','y':0},{'color':'#cae852','y':0},{'color':'#cae852','y':0},{'color':'#cae852','y':0},{'color':'#cae852','y':0},{'color':'#cae852','y':0},{'color':'#cae852','y':0},{'color':'#cae852','y':0},{'color':'#cae852','y':0},{'color':'#cae852','y':0}],
    //     data2:[{'color':'#0091ea','y':0},{'color':'#0091ea','y':0},{'color':'#0091ea','y':0},{'color':'#0091ea','y':0},{'color':'#0091ea','y':0},{'color':'#0091ea','y':0},{'color':'#0091ea','y':0},{'color':'#0091ea','y':0},{'color':'#0091ea','y':0},{'color':'#0091ea','y':0},{'color':'#0091ea','y':0}],
    //     data3:[{'color':'#0f0','y':0},{'color':'#0f0','y':0},{'color':'#0f0','y':0},{'color':'#0f0','y':0},{'color':'#0f0','y':0},{'color':'#0f0','y':0},{'color':'#0f0','y':0},{'color':'#0f0','y':0},{'color':'#0f0','y':0},{'color':'#0f0','y':0},{'color':'#0f0','y':0}],
    //     data4:[{'color':'#ff9b5a','y':0},{'color':'#ff9b5a','y':0},{'color':'#ff9b5a','y':0},{'color':'#ff9b5a','y':0},{'color':'#ff9b5a','y':0},{'color':'#ff9b5a','y':0},{'color':'#ff9b5a','y':0},{'color':'#ff9b5a','y':0},{'color':'#ff9b5a','y':0},{'color':'#ff9b5a','y':0},{'color':'#ff9b5a','y':0}],
    //     data5:[{'color':'#08faff','y':0},{'color':'#08faff','y':0},{'color':'#08faff','y':0},{'color':'#08faff','y':0},{'color':'#08faff','y':0},{'color':'#08faff','y':0},{'color':'#08faff','y':0},{'color':'#08faff','y':0},{'color':'#08faff','y':0},{'color':'#08faff','y':0},{'color':'#08faff','y':0}],
    //     data6:[{'color':'#17e833','y':0},{'color':'#17e833','y':0},{'color':'#17e833','y':0},{'color':'#17e833','y':0},{'color':'#17e833','y':0},{'color':'#17e833','y':0},{'color':'#17e833','y':0},{'color':'#17e833','y':0},{'color':'#17e833','y':0},{'color':'#17e833','y':0},{'color':'#17e833','y':0}],
    //     data7:[{'color':'#29dee8','y':0},{'color':'#29dee8','y':0},{'color':'#29dee8','y':0},{'color':'#29dee8','y':0},{'color':'#29dee8','y':0},{'color':'#29dee8','y':0},{'color':'#29dee8','y':0},{'color':'#29dee8','y':0},{'color':'#29dee8','y':0},{'color':'#29dee8','y':0},{'color':'#29dee8','y':0}],
    //     data8:[{'color':'#e8534f','y':0},{'color':'#e8534f','y':0},{'color':'#e8534f','y':0},{'color':'#e8534f','y':0},{'color':'#e8534f','y':0},{'color':'#e8534f','y':0},{'color':'#e8534f','y':0},{'color':'#e8534f','y':0},{'color':'#e8534f','y':0},{'color':'#e8534f','y':0},{'color':'#e8534f','y':0}],
    //     data9:[{'color':'#b94ce8','y':0},{'color':'#b94ce8','y':0},{'color':'#b94ce8','y':0},{'color':'#b94ce8','y':0},{'color':'#b94ce8','y':0},{'color':'#b94ce8','y':0},{'color':'#b94ce8','y':0},{'color':'#b94ce8','y':0},{'color':'#b94ce8','y':0},{'color':'#b94ce8','y':0},{'color':'#b94ce8','y':0}],
    //     data10:[{'color':'#1be8a4','y':0},{'color':'#1be8a4','y':0},{'color':'#1be8a4','y':0},{'color':'#1be8a4','y':0},{'color':'#1be8a4','y':0},{'color':'#1be8a4','y':0},{'color':'#1be8a4','y':0},{'color':'#1be8a4','y':0},{'color':'#1be8a4','y':0},{'color':'#1be8a4','y':0},{'color':'#1be8a4','y':0}],
    //     data11:[{'color':'#e8a738','y':0},{'color':'#e8a738','y':0},{'color':'#e8a738','y':0},{'color':'#e8a738','y':0},{'color':'#e8a738','y':0},{'color':'#e8a738','y':0},{'color':'#e8a738','y':0},{'color':'#e8a738','y':0},{'color':'#e8a738','y':0},{'color':'#e8a738','y':0},{'color':'#e8a738','y':0}],
    //     data12:[{'color':'#0721e8','y':0},{'color':'#0721e8','y':0},{'color':'#0721e8','y':0},{'color':'#0721e8','y':0},{'color':'#0721e8','y':0},{'color':'#0721e8','y':0},{'color':'#0721e8','y':0},{'color':'#0721e8','y':0},{'color':'#0721e8','y':0},{'color':'#0721e8','y':0},{'color':'#0721e8','y':0}],
    // },
    obj_6 = {
    data1:[0,0,0,0,0,0,0,0,0,0,0],
    data2:[0,0,0,0,0,0,0,0,0,0,0],
    data3:[0,0,0,0,0,0,0,0,0,0,0],
    data4:[0,0,0,0,0,0,0,0,0,0,0],
    data5:[0,0,0,0,0,0,0,0,0,0,0],
    data6:[0,0,0,0,0,0,0,0,0,0,0],
    data7:[0,0,0,0,0,0,0,0,0,0,0],
    data8:[0,0,0,0,0,0,0,0,0,0,0],
    data9:[0,0,0,0,0,0,0,0,0,0,0],
    data10:[0,0,0,0,0,0,0,0,0,0,0],
    data11:[0,0,0,0,0,0,0,0,0,0,0],
    data12:[0,0,0,0,0,0,0,0,0,0,0],
    },
    obj_time = {
        beginTime:'',
        endTime:''
    },
    obj_item ={
        index:'',
        item:''
    },
    c = [],
    color_5 = ['#0dc884','#40c4ff','#a3e9a4','#0091ea','#8bc34a','#81affe','#01579b','#84ffff','#00cdb9','#00806f','#00e892'],//Echart_5
    color_1 = ['#0091ea','#0f0','#ff9b5a','#08faff','#cae852','#17e833','#29dee8','#e8534f','#b94ce8','#1be8a4','#e8a738','#0721e8'];//Echart_1
$(document).ready(function(){
    var h = 1072;
    if($(window).height() >= h){
        $('body').css({height: h + 'px',paddingTop: Math.floor(($(window).height() - h) / 2) +'px',overflow:'hidden'});
    }
    $('.graphical_1').css('height',Math.floor(3*(h-150)/4) + 'px');
    $('.graphical_3').css('height',Math.floor((h-150)/4) + 'px');
    $('.contents .update').css('height',Math.floor((h-150)/4) - 55 + 'px');
    $('.graphical_5').css('height',Math.floor((h-150)) + 'px');
    $('.graphical1').css('height',Math.floor((h-150)/2) + 'px');
    $('#echart_5').css({height: $('.echart_5').height() + 'px'});
    //modal日期
    laydate.render({
        elem: '#test6',
        range: true,
        theme:'molv',
        max:time(),
        done: function(value, date, endDate){
            circleBeginTime = value.split(' - ')[0];
            circleEndTime = value.split(' - ')[1]
            modalTest();
        }
    });
    setInterval(function(){time()},1000);//1s
    setInterval(function(){
        Chage();//关键帧
        main_data();//数据填充
        //录入合格率
        admissionRate();
        if(defaultTime == 1){
            byWeek($('.Tag_click span').eq(0));
        }else if(defaultTime == 2){
            byMonth($('.Tag_click span').eq(1));
        }else if(defaultTime == 3){
            byYears($('.Tag_click span').eq(2));
        }
        if($('.resetSpan').css('display') == 'none'){
            resetCircle(event);
        }
    },600000);//10分钟 数据重新加载
    //主要数据
    main_data();
    //录入合格率
    admissionRate();
    //默认年加载
    byYears($('.Tag_click span').eq(2));
    //饼图
    resetCircle(event);
    modalTest();
})

//主要数据
function main_data(){
    //总数
    $.ajax({
        type:'get',
        url: baseUrls + 'showPage/amount',
        data: {
            time: defaultTime
        },
        success:function(response){
            if(response.responseCode == '1000'){
                response.content.amount.forEach(function(item){
                    clueamount(item);
                    caseamount(item);
                    orderamount(item);
                });
            }else{

            }
        },
        error:function(){

        }
    });
    //每日警情轮播
    $.ajax({
        type:'get',
        url: baseUrls + 'showPage/newestInfo',
        data: {
            time: defaultTime
        },
        success:function(data){
            if(data.responseCode == '1000'){
                //newestCase-每日警情
                $('.updataData').html('');
                for(var i = 0;i < data.content.newestCase.length;i++){
                    var str = '';
                    if(data.content.newestCase[i].CODE == '5'){
                        if(data.content.newestCase[i].AJMC){
                            str = '<div class="ellipsis"><div class="num">盗窃案</div><div class="date">'+ nulls(data.content.newestCase[i].SJ) +'</div><div class="ellipsisSpan" id="new' + (i + 1) +'" onmouseenter="moveIn(this)" onmouseout="moveOut(this)" onclick="showDetail(\''+ data.content.newestCase[i].AJBH +'\')">'+ nulls(data.content.newestCase[i].AJMC) +'</div>';
                        }else{
                            str = '<div class="ellipsis"><div class="num">盗窃案</div><div class="ellipsisSpan" id="new' + (i + 1) +'">今日暂无盗窃案</div>';
                        }
                    }else if(data.content.newestCase[i].CODE == '6'){
                        if(data.content.newestCase[i].AJMC){
                            str = '<div class="ellipsis"><div class="num">抢劫案</div><div class="date">'+ nulls(data.content.newestCase[i].SJ) +'</div><div class="ellipsisSpan" id="new' + (i + 1) +'" onmouseenter="moveIn(this)" onmouseout="moveOut(this)" onclick="showDetail(\''+ data.content.newestCase[i].AJBH +'\')">'+ nulls(data.content.newestCase[i].AJMC) +'</div>';
                        }else{
                            str = '<div class="ellipsis"><div class="num">抢劫案</div><div class="ellipsisSpan" id="new' + (i + 1) +'">今日暂无抢劫案</div>';
                        }
                    }else if(data.content.newestCase[i].CODE == '7'){
                        if(data.content.newestCase[i].AJMC){
                            str = '<div class="ellipsis"><div class="num">抢夺案</div><div class="date">'+ nulls(data.content.newestCase[i].SJ) +'</div><div class="ellipsisSpan" id="new' + (i + 1) +'" onmouseenter="moveIn(this)" onmouseout="moveOut(this)" onclick="showDetail(\''+ data.content.newestCase[i].AJBH +'\')">'+ nulls(data.content.newestCase[i].AJMC) +'</div>';
                        }else{
                            str = '<div class="ellipsis"><div class="num">抢夺案</div><div class="ellipsisSpan" id="new' + (i + 1) +'">今日暂无抢夺案</div>';
                        }
                    }else if(data.content.newestCase[i].CODE == '8'){
                        if(data.content.newestCase[i].AJMC){
                            str = '<div class="ellipsis"><div class="num">诈骗案</div><div class="date">'+ nulls(data.content.newestCase[i].SJ) +'</div><div class="ellipsisSpan" id="new' + (i + 1) +'" onmouseenter="moveIn(this)" onmouseout="moveOut(this)" onclick="showDetail(\''+ data.content.newestCase[i].AJBH +'\')">'+ nulls(data.content.newestCase[i].AJMC) +'</div>';
                        }else{
                            str = '<div class="ellipsis"><div class="num">诈骗案</div><div class="ellipsisSpan" id="new' + (i + 1) +'">今日暂无诈骗案</div>';
                        }
                    }else{
                        if(data.content.newestCase[i].AJMC){
                            str = '<div class="ellipsis"><div class="num">八类案件</div><div class="date">'+ nulls(data.content.newestCase[i].SJ) +'</div><div class="ellipsisSpan" id="new' + (i + 1) +'" onmouseenter="moveIn(this)" onmouseout="moveOut(this)">'+ nulls(data.content.newestCase[i].AJMC) +'</div>';
                        }else{
                            str = '<div class="ellipsis"><div class="num">八类案件</div><div class="ellipsisSpan" id="new' + (i + 1) +'">今日暂无八类案件</div>';
                        }
                    }
                    $('.updataData').append(str);
                }
                $('.updataData').append($('.updataData').html());
                clearInterval(newsTime);
                initial = 0;
                Scroll();//每日警情轮播
                if(firstGet == 1){
                    firstGet = 2;
                    //photo-图片播放
                    $('.slides').html('');
                    for(var i=0;i<data.content.photo.length;i++){
                        var newDiv = '<div><span><img src="'+data.content.photo[i].WLLJ+'" alt="'+ nulls(data.content.photo[i].AJMC) +'" onerror="nofind(this)" onclick="openImg(this)" title="'+ (i + 1) +'"></span><p>'+ nulls(data.content.photo[i].AJMC) +'</p></div>';
                        $('.slides').append(newDiv);
                    }
                    var _SlideshowTransitions = [
                        {$Duration:1200,y:-0.3,$Cols:2,$SlideOut:true,$ChessMode:{$Column:12},$Easing:{$Top:$JssorEasing$.$EaseInCubic,$Opacity:$JssorEasing$.$EaseLinear},$Opacity:2},
                        {$Duration:1000,y:4,$Zoom:11,$Easing:{$Top:$JssorEasing$.$EaseInCubic,$Zoom:$JssorEasing$.$EaseInCubic,$Opacity:$JssorEasing$.$EaseOutQuad},$Opacity:2},
                        {$Duration:1200,y:1,$Rows:2,$Zoom:1,$ChessMode:{$Row:15},$Easing:{$Top:$JssorEasing$.$EaseInCubic,$Zoom:$JssorEasing$.$EaseInCubic,$Opacity:$JssorEasing$.$EaseLinear},$Assembly:2049,$Opacity:2},
                        {$Duration:1500,x:-1,y:0.5,$Delay:60,$Cols:8,$Rows:4,$Formation:$JssorSlideshowFormations$.$FormationSquare,$Easing:{$Left:$JssorEasing$.$EaseSwing,$Top:$JssorEasing$.$EaseInWave},$Assembly:260,$Round:{$Top:1.5}},
                        {$Duration:600,x:-1,y:-1,$Delay:50,$Cols:8,$Rows:4,$SlideOut:true,$Formation:$JssorSlideshowFormations$.$FormationZigZag,$ChessMode:{$Column:3,$Row:12},$Easing:{$Left:$JssorEasing$.$EaseInCubic,$Top:$JssorEasing$.$EaseInCubic,$Opacity:$JssorEasing$.$EaseOutQuad},$Assembly:1028,$Opacity:2},
                        {$Duration:1000,x:-0.5,y:0.5,$Zoom:1,$Rotate:1,$SlideOut:true,$Easing:{$Left:$JssorEasing$.$EaseInCubic,$Top:$JssorEasing$.$EaseInCubic,$Zoom:$JssorEasing$.$EaseInCubic,$Opacity:$JssorEasing$.$EaseLinear,$Rotate:$JssorEasing$.$EaseInCubic},$Opacity:2,$Round:{$Rotate:0.5}},
                        {$Duration:1800,x:1,y:0.2,$Delay:30,$Cols:10,$Rows:5,$Clip:15,$During:{$Left:[0.3,0.7],$Top:[0.3,0.7]},$SlideOut:true,$Reverse:true,$Formation:$JssorSlideshowFormations$.$FormationStraightStairs,$Easing:{$Left:$JssorEasing$.$EaseInOutSine,$Top:$JssorEasing$.$EaseOutWave,$Clip:$JssorEasing$.$EaseInOutQuad},$Assembly:2050,$Round:{$Top:1.3}},
                        {$Duration:1800,x:1,$Delay:30,$Cols:10,$Rows:5,$Clip:15,$During:{$Left:[0.3,0.7]},$SlideOut:true,$Formation:$JssorSlideshowFormations$.$FormationStraightStairs,$Easing:{$Left:$JssorEasing$.$EaseInOutExpo,$Clip:$JssorEasing$.$EaseInOutQuad},$Assembly:260,$Outside:true,$Round:{$Top:0.8}},
                        {$Duration:1800,x:1,$Delay:30,$Cols:10,$Rows:5,$Clip:15,$During:{$Left:[0.3,0.7]},$Formation:$JssorSlideshowFormations$.$FormationStraightStairs,$Easing:{$Left:$JssorEasing$.$EaseInOutExpo,$Clip:$JssorEasing$.$EaseInOutQuad},$Assembly:260,$Outside:true,$Round:{$Top:0.8}},
                        {$Duration:1500,x:0.3,y:-0.3,$Delay:20,$Cols:8,$Rows:4,$Clip:15,$During:{$Left:[0.1,0.9],$Top:[0.1,0.9]},$SlideOut:true,$Formation:$JssorSlideshowFormations$.$FormationSwirl,$Easing:{$Left:$JssorEasing$.$EaseInJump,$Top:$JssorEasing$.$EaseInJump,$Clip:$JssorEasing$.$EaseOutQuad},$Assembly:260,$Outside:true,$Round:{$Left:0.8,$Top:2.5}},
                        {$Duration:1200,x:2,y:1,$Cols:2,$Zoom:11,$Rotate:1,$ChessMode:{$Column:15},$Easing:{$Left:$JssorEasing$.$EaseInCubic,$Top:$JssorEasing$.$EaseInCubic,$Zoom:$JssorEasing$.$EaseInCubic,$Opacity:$JssorEasing$.$EaseOutQuad,$Rotate:$JssorEasing$.$EaseInCubic},$Assembly:2049,$Opacity:2,$Round:{$Rotate:0.7}},
                        {$Duration:1000,$Rows:6,$Clip:4,$Move:true},
                        {$Duration:800,$Delay:150,$Cols:10,$Clip:1,$Move:true,$Formation:$JssorSlideshowFormations$.$FormationCircle,$Easing:$JssorEasing$.$EaseInBounce,$Assembly:264},
                        {$Duration:600,x:-1,y:1,$Delay:30,$Cols:8,$Rows:4,$Formation:$JssorSlideshowFormations$.$FormationStraightStairs,$Easing:{$Left:$JssorEasing$.$EaseInQuart,$Top:$JssorEasing$.$EaseInQuart,$Opacity:$JssorEasing$.$EaseLinear},$Opacity:2}

                    ];
                    var options = {
                        $AutoPlay: true,
                        $SlideshowOptions: {
                            $Class: $JssorSlideshowRunner$,
                            $Transitions: _SlideshowTransitions,
                            $TransitionsOrder: 1,
                            $ShowLink: true
                        },
                        $ArrowNavigatorOptions: {
                            $Class: $JssorArrowNavigator$
                        },
                        $BulletNavigatorOptions: {
                            $Class: $JssorBulletNavigator$
                        }
                    };
                    var jssor_slider1 = new $JssorSlider$('slider1_container', options);
                }
            }else{

            }
        },
        error:function(){

        }
    });
    //全市录入统计
    $.ajax({
        type:'get',
        url: baseUrls + 'showPage/inputCount',
        data: {
            time: defaultTime
        },
        success:function(data){
            if(data.responseCode == '1000'){
                //case和clue--全市录入情况
                obj_3 = {
                    name:[],
                    data_3_Clue:[],
                    no_Num: [],
                    data_3_Case:[]
                };
                for(var i = 0;i<data.content.case.length;i++) {
                    obj_3.name.push(data.content.case[i].SHORTNAME);
                    obj_3.data_3_Case.push(data.content.case[i].AMOUNT);
                    var flag = true;
                    for (var j = 0; j < data.content.clue.length; j++) {
                        if (data.content.clue[j].ORGCODE == data.content.case[i].ORGCODE){
                            obj_3.data_3_Clue.push(data.content.clue[j].HAS_NUM);
                            obj_3.no_Num.push(data.content.clue[j].NO_NUM);
                            flag = false;
                            break;
                        }
                    }
                    if(flag){
                        obj_3.data_3_Clue.push(0);
                        obj_3.no_Num.push(0);
                    }
                }
                option_3(obj_3);
            }else{

            }
        },
        error:function(){

        }
    });
    //指令统计
    $.ajax({
        type:'get',
        url: baseUrls + 'showPage/order',
        data: {
            time: defaultTime
        },
        beforeSend: function(){
            if(firstGet == 1){
                Loading();
            }
        },
        success:function(data){
            closeLoading();
            if(data.responseCode == '1000'){
                obj_5 = {
                    dataName:[],
                    dataValue:[]
                };
                    //order-指令完成情况
                    obj =  {
                        value_1:[],
                        value_2:[],
                        name:[],
                        labelFromatter:[],
                        orgCode: []
                    };
                    for(var i = 0;i<data.content.order.length;i++){
                        data.content.order[i].COM_AMOUNT ? obj.value_1.push(data.content.order[i].COM_AMOUNT) : obj.value_1.push(0);
                        data.content.order[i].AMOUNT ? obj.value_2.push(data.content.order[i].AMOUNT - (data.content.order[i].COM_AMOUNT ? data.content.order[i].COM_AMOUNT : 0)) : obj.value_2.push(0);
                        obj.name.push(nulls(data.content.order[i].SHORT_NAME));
                        obj.labelFromatter.push({
                            normal : {
                                label : {
                                    formatter : function (params){
                                        return params.value
                                    },
                                    textStyle: {
                                        baseline : 'top'
                                    }
                                }
                            }
                        });
                        obj.orgCode.push(data.content.order[i].ORG_CODE ? data.content.order[i].ORG_CODE : 0);
                    };
                    option_4(obj);
            }else{
                Msg();
            }
        },
        error:function(){
            closeLoading();
            Msg();
        }
    });

}
//clueRate-录入率
function admissionRate(item){
    //ajlx 1 八大类  空为全部
    var type = 1;
    if(item){
        if($(item).html() == '全部'){
            type = '';
            $(item).html('关注');
        }else{
            type = 1;
            $(item).html('全部');
        }
    }
    $.ajax({
        type: 'get',
        url: baseUrls + 'showPage/clueRate',
        data:{
            ajlx: type,
            time: defaultTime
        },
        beforeSend: function(){
            if(firstGet == 1){
                Loading();
            }
        },
        success: function(response){
            closeLoading();
            if(response.responseCode == '1000'){
                if(response.content.clueRate.length > 0){
                    obj_5 = {
                        dataName: [],
                        dataValue: []
                    }
                    for(var i = 0;i<response.content.clueRate.length;i++){
                        obj_5.dataName.push(response.content.clueRate[i].shortName);
                        obj_5.dataValue.push(parseFloat(((response.content.clueRate[i].num / response.content.clueRate[i].amount)*100).toFixed(2)));
                    }
                    option_5(obj_5);
                }else{
                    Msg('暂无数据');
                }
            }else{
                Msg();
            }
        },
        error: function(){
            closeLoading();
            Msg();
        }
    })
}
//饼图弹出框请求
function modalTest(){
    $.ajax({
        type:"get",
        url:baseUrls+'showPage/caseCountDetail',
        data:{
            beginTime: circleBeginTime,
            endTime: circleEndTime
        },
        async:true,
        beforeSend: function(){
            Loading();
        },
        success:function(data){
            closeLoading();
            if(data.responseCode == '1000'){
                if(data.content.Z520102){
                    obj_item.item = data.content.Z520102;
                    obj_item.index = 6;
                    judge(obj_item);
                };
                if(data.content.Z520103){
                    obj_item.item = data.content.Z520103;
                    obj_item.index = 0;
                    judge(obj_item);
                };
                if(data.content.Z520111){
                    obj_item.item = data.content.Z520111;
                    obj_item.index = 8;
                    judge(obj_item);
                };
                if(data.content.Z520112){
                    obj_item.item = data.content.Z520112;
                    obj_item.index = 1;
                    judge(obj_item);
                };
                if(data.content.Z520113){
                    obj_item.item = data.content.Z520113;
                    obj_item.index = 7;
                    judge(obj_item);
                };
                if(data.content.Z520114){
                    obj_item.item = data.content.Z520114;
                    obj_item.index = 2;
                    judge(obj_item);
                };
                if(data.content.Z520121){
                    obj_item.item = data.content.Z520121;
                    obj_item.index = 3;
                    judge(obj_item);
                };
                if(data.content.Z520160){
                    obj_item.item = data.content.Z520160;
                    obj_item.index = 5;
                    judge(obj_item);
                };
                if(data.content.Z520122){
                    obj_item.item = data.content.Z520122;
                    obj_item.index = 9;
                    judge(obj_item);
                };
                if(data.content.Z520123){
                    obj_item.item = data.content.Z520123;
                    obj_item.index = 4;
                    judge(obj_item);
                };
                if(data.content.Z520181){
                    obj_item.item = data.content.Z520181;
                    obj_item.index = 10;
                    judge(obj_item);
                };
                option_6(obj_6);
            }else{
                Msg();
            }
        },
        error:function(){
            closeLoading();
            Msg();
        }
    });
}
//饼图弹出框数据填充
function judge(obj_item){
    for(var i=0;i<obj_item.item.length;i++){
        if(obj_item.item[i].CODE == 0){
            obj_6.data1[obj_item.index] = obj_item.item[i].AMOUNT;
        }else if(obj_item.item[i].CODE==5){
            obj_6.data2[obj_item.index] = obj_item.item[i].AMOUNT;
        }else if(obj_item.item[i].CODE==6){
            obj_6.data3[obj_item.index] = obj_item.item[i].AMOUNT;
        }else if(obj_item.item[i].CODE==7){
            obj_6.data4[obj_item.index] = obj_item.item[i].AMOUNT;
        }else if(obj_item.item[i].CODE==8){
            obj_6.data5[obj_item.index] = obj_item.item[i].AMOUNT;
        }else if(obj_item.item[i].CODE==10){
            obj_6.data6[obj_item.index] = obj_item.item[i].AMOUNT;
        }else if(obj_item.item[i].CODE==11){
            obj_6.data7[obj_item.index] = obj_item.item[i].AMOUNT;
        }else if(obj_item.item[i].CODE==12){
            obj_6.data8[obj_item.index] = obj_item.item[i].AMOUNT;
        }else if(obj_item.item[i].CODE==13){
            obj_6.data9[obj_item.index] = obj_item.item[i].AMOUNT;
        }else if(obj_item.item[i].CODE==14){
            obj_6.data10[obj_item.index] = obj_item.item[i].AMOUNT;
        }else if(obj_item.item[i].CODE==15){
            obj_6.data11[obj_item.index] = obj_item.item[i].AMOUNT;
        }else if(obj_item.item[i].CODE==16){
            obj_6.data12[obj_item.index] = obj_item.item[i].AMOUNT;
        }
    }
}
//数字滚动
var comma_separator_number_step = $.animateNumber.numberStepFactories.separator(',');
function clueamount(item){
    $('#Input_quantity').animateNumber(
        {
            number: item.CLUEAMOUNT,
            numberStep: comma_separator_number_step
        },
        3000
    );
};
function caseamount(item){
    $('#Case_volume').animateNumber(
        {
            number:item.CASEAMOUNT,
            numberStep: comma_separator_number_step
        },
        3000
    );
}
function orderamount(item){
    $('#instructions').animateNumber(
        {
            number: item.ORDERAMOUNT,
            numberStep: comma_separator_number_step
        },
        3000
    );
}

//图片路径找不到
function nofind(item){
    item.src = 'showIndex/img/4.jpg';
    item.onerror = null;
}
function openImg(item){
    layer.photos({
        photos: '.slides'
        ,anim: 5 //0-6的选择，指定弹出图片动画类型，默认随机（请注意，3.0之前的版本用shift参数）
    });
}
//获取时间
function time(){
    var myDate = new Date();
    var year = myDate.getFullYear();//获取当前年
    var yue = myDate.getMonth()+1;//获取当前月
    var date = myDate.getDate();//获取当前日
    var h = myDate.getHours();//获取当前小时数(0-23)
    var m = myDate.getMinutes();//获取当前分钟数(0-59)
    var s = myDate.getSeconds();//获取当前秒
    if(yue<10){
        yue = "0"+yue;
    }
    if(date<10){
        date= "0"+ date;
    }
    if(h<10){
        h="0"+h;
    }
    if(s<10){
        s="0"+s;
    }
    if(m<10){
        m="0"+m;
    }
    $("#heading_top_time .top_time").html(h + ":" + m + ":" + s);
    $("#heading_top_time .bottom_date").html(year + "年" + yue + "月" + date + "日");
    return year+"-"+yue+"-"+date;
};
//动画
function Chage(){
    if($('#echart_3')[0].className == 'echart_3_anim_Y'){
        $('#echart_3').removeClass('echart_3_anim_Y');
        $('#echart_3').addClass('echart_3_anim_X')
    }else{
        $('#echart_3').removeClass('echart_3_anim_X');
        $('#echart_3').addClass('echart_3_anim_Y');
    };
    if($('#echart_4')[0].className == 'echart_4_anim_Y'){
        $('#echart_4').removeClass('echart_4_anim_Y');
        $('#echart_4').addClass('echart_4_anim_X')
    }else{
        $('#echart_4').removeClass('echart_4_anim_X');
        $('#echart_4').addClass('echart_4_anim_Y');
    };
    if($('#echart_5')[0].className == 'echart_5_anim_Y'){
        $('#echart_5').removeClass('echart_5_anim_Y');
        $('#echart_5').addClass('echart_5_anim_X')
    }else{
        $('#echart_5').removeClass('echart_5_anim_X');
        $('#echart_5').addClass('echart_5_anim_Y');
    }
}
// echart_1
/*饼图*/
function option_1(dataOne){
    var colors = [],
        caseTypes = ['5','6','7','8','9','10','11','12','13','14','15','16'];//案件类型
       for(var i = 0; i < dataOneCode.length; i++){
           colors.push(color_1[caseTypes.indexOf(dataOneCode[i])]);
       };
    Highcharts.getOptions().colors = Highcharts.map(colors, function (color) {
        return {
            radialGradient: { cx: 0.5, cy: 0.3, r: 0.7 },
            stops: [
                [0, color],
                [1, Highcharts.Color(color).brighten(-14).get('rgb')] // darken
            ]
        };
    });
    $('#echart_1').highcharts({
        chart: {
            type: 'pie',
            options3d: {
                enabled: true,
                alpha: 45,
                beta: 0
            },
            backgroundColor:'rgba(23, 83, 93, 0)',
        },
        title: {
            text: ''
        },
        tooltip: {
            pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
        },
        exporting:{
            enabled: false
        },
        plotOptions: {
            pie: {
                allowPointSelect: true,
                cursor: 'pointer',
                depth: 35,
                dataLabels: {
                    enabled: true,
                    format: '{point.name}',
                    useHTML: true,
                    style: {
                        color: 'rgb(0,205,185)',
                        fontSize:'14px',
                        fontFamily:'微软雅黑'
                    }
                }
            }
        },
        series: [{
            type: 'pie',
            name: '案件类别',
            data: dataOne,
            events: {
                click: function(e){
                    var iframeData = [],
                        Index = e.point.index;
                    $.ajax({
                        type: 'get',
                        url: baseUrls + 'showPage/caseCountDetail',
                        data:{
                            endTime: circleEndTime,
                            beginTime: circleBeginTime,
                            ajlx: dataOneCode[Index],
                        },
                        beforeSend:function(){
                            Loading();
                        },
                        success:function(response){
                            closeLoading();
                            if(response.responseCode == '1000'){
                                IframeData(response,iframeData);
                                var closeIndex = layer.open({
                                    type: 2,
                                    title: ['<div class="layer_title">'+ e.point.name.substring(0,e.point.name.indexOf("(")) +'</div>', 'background:url(../showIndex/img/index.png); color:#fff;'],
                                    skin: 'layui-layer-rim', //加上边框
                                    area: ['1100px', '700px'], //宽高
                                    scrollbar: false,
                                    shadeClose: true,
                                    move: false,
                                    content:'showIndex/data.html?' + iframeData + '&' + dataOneCode[Index] + '&' + encodeURI(e.point.name.substring(0,e.point.name.indexOf("("))),
                                    success:function (layero,index) {
                                        $('.layui-layer.layui-layer-iframe.layui-layer-rim').css({display: 'block'});
                                    },
                                    cancel: function(layero,index){
                                        layer.close(closeIndex);
                                    }
                                });
                            }else{
                                Msg();
                            }
                        },
                        error:function(){
                            closeLoading();
                            Msg();
                        }
                    })
                }
            }
        }]
    });
}
// function option_1(dataOne){
//     var option = {
//         animationDuration:3000,
//         title : {
//             text: '',
//             subtext: '',
//             x:'center'
//         },
//         tooltip : {
//             trigger: 'item',
//             formatter: "{a} <br/>{b} : {c} ({d}%)"
//         },
//         series : [
//             {
//                 name: '案件类别',
//                 type: 'pie',
//                 radius : '75%',
// //		            roseType : 'radius',
//                 center: ['50%', '60%'],
//                 clickable:true,
//                 data:dataOne,
//                 itemStyle: {
//                     emphasis: {
//                         shadowBlur: 10,
//                         shadowOffsetX: 0,
//                         shadowColor: 'rgba(0, 0, 0, 0.5)'
//                     }
//                 },
//                 label: {
//                     normal: {
//                         textStyle: {
//                             color: 'rgba(176, 243, 243, 1)',
//                             fontSize:'18'
//                         }
//                     }
//                 },
//             }
//         ]
//     };
//     var myChart_1 = echarts.init(document.getElementById('echart_1'));
//     myChart_1.clear();
//     myChart_1.setOption(option);
//     if(firstCircle == 1){
//         firstCircle = 2;
//         myChart_1.on('click', function (params) {
//             var iframeData = [],
//                 Index = params.dataIndex;
//             $.ajax({
//                 type: 'get',
//                 url: baseUrls + 'showPage/caseCountDetail',
//                 data:{
//                     endTime: time() + ' 23:59:59',
//                     beginTime: time().split('-')[0]-1+'-'+time().split('-')[1]+'-'+time().split('-')[2] + ' 00:00:00',
//                     ajlx: dataOneCode[Index],
//                 },
//                 beforeSend:function(){
//                     Loading();
//                 },
//                 success:function(response){
//                     closeLoading();
//                     if(response.responseCode == '1000'){
//                         IframeData(response,iframeData);
//                         var closeIndex = layer.open({
//                             type: 2,
//                             title: ['<div class="layer_title">'+ params.name.substring(0,params.name.indexOf("(")) +'</div>', 'background:url(../showIndex/img/index.png); color:#fff;'],
//                             skin: 'layui-layer-rim', //加上边框
//                             area: ['1100px', '700px'], //宽高
//                             scrollbar: false,
//                             shadeClose: true,
//                             move: false,
//                             content:'showIndex/data.html?' + iframeData + '&' + dataOneCode[Index] + '&' + encodeURI(params.name.substring(0,params.name.indexOf("("))),
//                             success:function (layero,index) {
//                                 $('.layui-layer.layui-layer-iframe.layui-layer-rim').css({display: 'block'});
//                             },
//                             cancel: function(layero,index){
//                                 layer.close(closeIndex);
//                             }
//                         });
//                     }else{
//                         Msg();
//                     }
//                 },
//                 error:function(){
//                     closeLoading();
//                     Msg();
//                 }
//             })
//         });
//     }
// };
//echart_2 年
function option_2(data){
    var str = [],
        xData = [],
        color = [];
    if(data.case_5.length > 0){
        xData.push('盗窃案');
        color.push(color_1[0]);
        str.push(
            {
                name: '盗窃案',
                type:'line',
                stack: '总量',
                data: data.case_5,
                itemStyle : {
                    normal : {
                        lineStyle:{
                            color: color_1[0]
                        }
                    }
                },
                smooth:'false',
                markPoint:{
                    effect:{
                        show: true,
                        type: 'scale',
                        loop: true,
                        period: 15,
                        scaleSize : 2,
                        bounceDistance: 10,
                        color : 'green',
                        shadowColor : 'green',
                        shadowBlur : 0
                    }
                }
            }
        );
    }
    if(data.case_6.length > 0){
        xData.push('抢劫案');
        color.push(color_1[1]);
        str.push(
            {
                name: '抢劫案',
                type:'line',
                stack: '总量',
                data: data.case_6,
                itemStyle : {
                    normal : {
                        lineStyle:{
                            color: color_1[1]
                        }
                    }
                },
                smooth:'false',
                markPoint:{
                    effect:{
                        show: true,
                        type: 'scale',
                        loop: true,
                        period: 15,
                        scaleSize : 2,
                        bounceDistance: 10,
                        color : 'green',
                        shadowColor : 'green',
                        shadowBlur : 0
                    }
                }
            }
        );
    }
    if(data.case_7.length > 0){
        xData.push('抢夺案');
        color.push(color_1[2]);
        str.push(
            {
                name: '抢夺案',
                type:'line',
                stack: '总量',
                data: data.case_7,
                itemStyle : {
                    normal : {
                        lineStyle:{
                            color:color_1[2]
                        }
                    }
                },
                smooth:'false',
                markPoint:{
                    effect:{
                        show: true,
                        type: 'scale',
                        loop: true,
                        period: 15,
                        scaleSize : 2,
                        bounceDistance: 10,
                        color : 'green',
                        shadowColor : 'green',
                        shadowBlur : 0
                    }
                }
            }
        );
    }
    if(data.case_8.length > 0){
        xData.push('诈骗案');
        color.push(color_1[3]);
        str.push(
            {
                name: '诈骗案',
                type:'line',
                stack: '总量',
                data: data.case_8,
                itemStyle : {
                    normal : {
                        lineStyle:{
                            color:color_1[3]
                        }
                    }
                },
                smooth:'false',
                markPoint:{
                    effect:{
                        show: true,
                        type: 'scale',
                        loop: true,
                        period: 15,
                        scaleSize : 2,
                        bounceDistance: 10,
                        color : 'green',
                        shadowColor : 'green',
                        shadowBlur : 0
                    }
                }
            }
        );
    }
    if(data.case_9.length > 0){
        xData.push('八类案件');
        color.push(color_1[4]);
        str.push(
            {
                name: '八类案件',
                type:'line',
                stack: '总量',
                data: data.case_9,
                itemStyle : {
                    normal : {
                        lineStyle:{
                            color: color_1[4]
                        }
                    }
                },
                smooth:'false',
                markPoint:{
                    effect:{
                        show: true,
                        type: 'scale',
                        loop: true,
                        period: 15,
                        scaleSize : 2,
                        bounceDistance: 10,
                        color : 'green',
                        shadowColor : 'green',
                        shadowBlur : 0
                    }
                }
            }
        );
    };
    if(data.case_10.length > 0){
        xData.push('放火案');
        color.push(color_1[5]);
        str.push(
            {
                name: '放火案',
                type:'line',
                stack: '总量',
                data: data.case_10,
                itemStyle : {
                    normal : {
                        lineStyle:{
                            color:color_1[5]
                        }
                    }
                },
                smooth:'false',
                markPoint:{
                    effect:{
                        show: true,
                        type: 'scale',
                        loop: true,
                        period: 15,
                        scaleSize : 2,
                        bounceDistance: 10,
                        color : 'green',
                        shadowColor : 'green',
                        shadowBlur : 0
                    }
                }
            }
        );
    };
    if(data.case_11.length > 0){
        xData.push('爆炸案');
        color.push(color_1[6]);
        str.push(
            {
                name: '爆炸案',
                type:'line',
                stack: '总量',
                data: data.case_11,
                itemStyle : {
                    normal : {
                        lineStyle:{
                            color:color_1[6]
                        }
                    }
                },
                smooth:'false',
                markPoint:{
                    effect:{
                        show: true,
                        type: 'scale',
                        loop: true,
                        period: 15,
                        scaleSize : 2,
                        bounceDistance: 10,
                        color : 'green',
                        shadowColor : 'green',
                        shadowBlur : 0
                    }
                }
            }
        );
    };
    if(data.case_12.length > 0){
        xData.push('劫持案');
        color.push(color_1[7]);
        str.push(
            {
                name: '劫持案',
                type:'line',
                stack: '总量',
                data: data.case_12,
                itemStyle : {
                    normal : {
                        lineStyle:{
                            color:color_1[7]
                        }
                    }
                },
                smooth:'false',
                markPoint:{
                    effect:{
                        show: true,
                        type: 'scale',
                        loop: true,
                        period: 15,
                        scaleSize : 2,
                        bounceDistance: 10,
                        color : 'green',
                        shadowColor : 'green',
                        shadowBlur : 0
                    }
                }
            }
        );
    };
    if(data.case_13.length > 0){
        xData.push('杀人案');
        color.push(color_1[8]);
        str.push(
            {
                name: '杀人案',
                type:'line',
                stack: '总量',
                data: data.case_13,
                itemStyle : {
                    normal : {
                        lineStyle:{
                            color:color_1[8]
                        }
                    }
                },
                smooth:'false',
                markPoint:{
                    effect:{
                        show: true,
                        type: 'scale',
                        loop: true,
                        period: 15,
                        scaleSize : 2,
                        bounceDistance: 10,
                        color : 'green',
                        shadowColor : 'green',
                        shadowBlur : 0
                    }
                }
            }
        );
    };
    if(data.case_14.length > 0){
        xData.push('伤害案');
        color.push(color_1[9]);
        str.push(
            {
                name: '伤害案',
                type:'line',
                stack: '总量',
                data: data.case_14,
                itemStyle : {
                    normal : {
                        lineStyle:{
                            color:color_1[9]
                        }
                    }
                },
                smooth:'false',
                markPoint:{
                    effect:{
                        show: true,
                        type: 'scale',
                        loop: true,
                        period: 15,
                        scaleSize : 2,
                        bounceDistance: 10,
                        color : 'green',
                        shadowColor : 'green',
                        shadowBlur : 0
                    }
                }
            }
        );
    };
    if(data.case_15.length > 0){
        xData.push('强奸案');
        color.push(color_1[10]);
        str.push(
            {
                name: '强奸案',
                type:'line',
                stack: '总量',
                data: data.case_15,
                itemStyle : {
                    normal : {
                        lineStyle:{
                            color:color_1[10]
                        }
                    }
                },
                smooth:'false',
                markPoint:{
                    effect:{
                        show: true,
                        type: 'scale',
                        loop: true,
                        period: 15,
                        scaleSize : 2,
                        bounceDistance: 10,
                        color : 'green',
                        shadowColor : 'green',
                        shadowBlur : 0
                    }
                }
            }
        );
    };
    if(data.case_16.length > 0){
        xData.push('绑架案');
        color.push(color_1[11]);
        str.push(
            {
                name: '绑架案',
                type:'line',
                stack: '总量',
                data: data.case_16,
                itemStyle : {
                    normal : {
                        lineStyle:{
                            color:color_1[11]
                        }
                    }
                },
                smooth:'false',
                markPoint:{
                    effect:{
                        show: true,
                        type: 'scale',
                        loop: true,
                        period: 15,
                        scaleSize : 2,
                        bounceDistance: 10,
                        color : 'green',
                        shadowColor : 'green',
                        shadowBlur : 0
                    }
                }
            }
        );
    };
    var option = {
        animationDuration:3000,
        title: {
            text: ''
        },
        color: color,
        legend: {
            data: xData,
            textStyle:{
                color:'auto'
            }
        },
        tooltip: {
            trigger: 'axis'
        },
        grid: {
            top:'10%',
            left: '3%',
            right: '4%',
            bottom: '10%',
            containLabel: true
        },
        xAxis: {
            type: 'category',
            boundaryGap: false,
            data: data.x,
            axisLine: {
                lineStyle: {
                    color: "#b0f3f3"
                }
            },
            axisLabel:{
                color:'red',
                rotate:'45',
                interval:'0'
            }
        },
        yAxis: {
            type: 'value',
            axisLine: {
                lineStyle: {
                    color: "#b0f3f3"
                }
            },
            splitLine:{
                show:false,
                lineStyle:{
                    color:'rgba(255,255,255,0.2)'
                }
            }
        },
        series: str
    };
    var myChart_2 = echarts.init(document.getElementById('echart_2'));
    myChart_2.clear();
    myChart_2.setOption(option);
}
// echart_3
function option_3(obj_3){
    // cy 如果是负值 则表示从上到下的渐变，如果是正值则表示上边是浅色，下面是深色
    // brighten(14)正数表示变浅，负值是加深
    var colors = ['#0dc884','#0091ea','#00cdb9'];
    Highcharts.getOptions().colors = Highcharts.map(colors, function (color) {
        return {
            radialGradient: { cx:0, cy: 1,r:2.3 },
            stops: [[0, color], [2, Highcharts.Color(color).brighten(-14).get('rgb')] // darken
            ]
        };
    });
    $('#echart_3').highcharts({
        chart: {
            type: 'column',
            backgroundColor:'rgba(23, 83, 93, 0.4)',
            options3d: {
                enabled: true,
                alpha: 0,
                beta: 0,
                viewDistance: 20,
                depth: 100
            },
            borderWidth: 1,
            borderColor: 'rgb(0,205,185)',
            marginBottom: 65,
            animation: {
                duration: 6000
            }
            // marginTop: 80,
            // marginRight: 40
        },
        exporting:{
            enabled: false
        },
        title: {
            text: ''
        },
        xAxis: {
            categories: obj_3.name,
            gridLineWidth: 0,
            labels: {
                formatter: function () {
                    return this.value
                },
                style: {
                    color: 'rgb(0,205,185)',
                    fontSize:'12px',
                    fontFamily:'微软雅黑'
                }
            },
            lineWidth: 1,
        },
        yAxis: {
            allowDecimals: false,
            gridLineWidth: 0,
            min: 0,
            title: {
                text: ''
            },
            labels: {
                formatter: function () {
                    return this.value
                },
                style: {
                    color: 'rgb(0,205,185)',
                    fontSize:'12px',
                    fontFamily:'微软雅黑'
                }
            },
            lineWidth: 1
        },
        legend:{
            align: 'right',
            verticalAlign: 'top',
            itemStyle:{
                cursor: 'pointer',
                color: 'rgb(0,205,185)'
            },
            itemHoverStyle:{
                color: 'rgb(0,205,185)'
            },
            itemHiddenStyle:{
                color: 'rgba(0,0,0,.3)'
            }
        },
        tooltip: {
            headerFormat: '<b>{point.key}</b><br>',
            pointFormat: '<span style="color:{series.color}">\u25CF</span> {series.name}: {point.y} / {point.stackTotal}'
        },
        plotOptions: {
            column: {
                // stacking: 'normal',
                depth: 25,
                dataLabels: {
                    align: 'center',
                    enabled: true, // dataLabels设为true
                    useHTML: true,
                    style: {
                        color: 'rgb(0,205,185)',
                        fontSize: '14px',
                        fontFamily: '微软雅黑'

                    },
                    x:0,
                    y: 0
                }
            }
        },
        series: [{
            name: '线索(文件)',
            data: obj_3.no_Num,
            stack: 'ss'
        }, {
            name: '线索(文字)',
            data: obj_3.data_3_Clue,
            stack: 'male'
        }, {
            name: '案件',
            data: obj_3.data_3_Case,
            stack: 'female'
        }]
    });
}
// function option_3(obj_3){
//     var option = {
//         tooltip : {
//             trigger: 'axis'
//         },
//         animationDuration:6000,
//         legend: {
//             data:['线索(图片)',,'线索(文字)','案件'],
//             textStyle:{
//                 color:'#fff'
//             }
//         },
//         calculable : true,
//         grid: {
//             show:true,
//             backgroundColor:'rgba(23, 83, 93, 0.4)',
//             top:'10%',
//             left: '3%',
//             right: '4%',
//             bottom: '8%',
//             containLabel: true,
//
//         },
//         xAxis : [
//             {
//                 type : 'category',
//                 data : obj_3.name,
//                 axisLine: {
//                     lineStyle: {
//                         color: "#b0f3f3"
//                     }
//                 },
//                 axisLabel:{
//                     color:'red',
//                     rotate:'45',
//                     interval:'0'
//                 },
//             }
//         ],
//         yAxis : [
//             {
//                 type : 'value',
//                 boundaryGap : [0, 0.01],
//                 axisLine: {
//                     lineStyle: {
//                         color: "#b0f3f3"
//                     }
//                 },
//                 splitLine:{
//                     show:false,
//                     lineStyle:{
//                         color:'rgba(255,255,255,0.3)'
//                     }
//                 }
//             }
//         ],
//         series : [
//             {
//                 name:'线索(图片)',
//                 type:'bar',
//                 data: obj_3.data_3_Clue,
//                 barWidth:'10',
//                 barGap:'80%',
//                 markPoint:{
//                     large:true,
//                     effect:{
//                         show: true,
//                         type: 'scale',
//                         loop: true,
//                         period: 15,
//                         scaleSize : 2,
//                         bounceDistance: 10,
//                         color : null,
//                         shadowColor : null,
//                         shadowBlur : 10
//                     }
//                 },
//                 itemStyle:{
//                     normal: {
//                         barBorderRadius:[10, 10, 0, 0],
//                         color:'#0dc884',
//                         label : {
//                             show: true,
//                             position: 'top',
//                             formatter : function (params){
//                                 return params.value
//                             },
//                         }
//                     },
//
//                 }
//             },
//             {
//                 name:'线索(文字)',
//                 type:'bar',
//                 data:obj_3.no_Num,
//                 barWidth:'10',
//                 barGap:'80%',
//                 markPoint:{
//                     large:true,
//                     effect:{
//                         show: true,
//                         type: 'scale',
//                         loop: true,
//                         period: 15,
//                         scaleSize : 2,
//                         bounceDistance: 10,
//                         color : null,
//                         shadowColor : null,
//                         shadowBlur : 10
//                     }
//                 },
//                 itemStyle:{
//                     normal: {
//                         barBorderRadius:[10, 10, 0, 0],
//                         color:'#0091ea',
//                         label : {
//                             show: true,
//                             position: 'top',
//                             formatter : function (params){
//                                 return params.value
//                             },
//                         }
//                     },
//
//                 }
//             },
//             {
//                 name:'案件',
//                 type:'bar',
//                 data:obj_3.data_3_Case,
//                 barWidth:'10',
//                 barGap:'80%',
//                 markPoint:{
//                     large:true,
//                     effect:{
//                         show: true,
//                         type: 'scale',
//                         loop: true,
//                         period: 15,
//                         scaleSize : 2,
//                         bounceDistance: 10,
//                         color : null,
//                         shadowColor : null,
//                         shadowBlur : 10
//                     }
//                 },
//                 itemStyle:{
//                     normal: {
//                         barBorderRadius:[10, 10, 0, 0],
//                         color:'#00cdb9',
//                         label : {
//                             show: true,
//                             position: 'top',
//                             formatter : function (params){
//                                 return params.value
//                             },
//                         }
//                     },
//
//                 }
//             }
//         ]
//     };
//     var myChart_3 = echarts.init(document.getElementById('echart_3'));
//         myChart_3.clear();
//     myChart_3.setOption(option);
// }
//echart_4
function option_4(obj){
    var labelTop = {
        normal : {
            label : {
                show : true,
                position : 'center',
                formatter : '{b}',
                textStyle: {
                    baseline : 'bottom'
                }
            },
            labelLine : {
                show : false
            }
        }
    };
    var labelBottom = {
        normal : {
            color: '#ccc',
            label : {
                show : true,
                position : 'center'
            },
            labelLine : {
                show : false
            }
        },
        emphasis: {

        }
    };
    var radius = [35, 50];
    var option = {
        animationDuration:3000,
        backgroundColor:'rgba(23,83,93,0.5)',

        title : {
            text: '',
            subtext: '',
            x: 'center'
        },
        series : [
            {
                type : 'pie',
                center : ['10%', '30%'],
                radius : radius,
                x: '0%', // for funnel
                itemStyle : obj.labelFromatter[0],
                data : [
                    {name:'other', value:obj.value_2[0], itemStyle : labelBottom},
                    {
                        name:obj.name[0],
                        value:obj.value_1[0],
                        itemStyle: {
                            normal: {
                                color:color_5[0],
                                label : {
                                    show : true,
                                    position : 'center',
                                    formatter : '{b}',
                                    textStyle: {
                                        baseline : 'bottom'
                                    }
                                },
                                labelLine : {
                                    show : false
                                }
                            },
                            emphasis: {

                            }
                        }
                    }
                ]
            },
            {
                type : 'pie',
                center : ['26%', '30%'],
                radius : radius,
                x:'15%', // for funnel
                itemStyle : obj.labelFromatter[1],
                data : [
                    {name:'other', value:obj.value_2[1], itemStyle : labelBottom},
                    {
                        name:obj.name[1],
                        value:obj.value_1[1],
                        itemStyle: {
                            normal: {
                                color:color_5[1],
                                label : {
                                    show : true,
                                    position : 'center',
                                    formatter : '{b}',
                                    textStyle: {
                                        baseline : 'bottom'
                                    }
                                },
                                labelLine : {
                                    show : false
                                }
                            },
                            emphasis: {

                            }
                        }
                    }
                ]
            },
            {
                type : 'pie',
                center : ['42%', '30%'],
                radius : radius,
                x:'30%', // for funnel
                itemStyle : obj.labelFromatter[2],
                data : [
                    {name:'other', value:obj.value_2[2], itemStyle : labelBottom},
                    {
                        name:obj.name[2],
                        value:obj.value_1[2],
                        itemStyle: {
                            normal: {
                                color:color_5[2],
                                label : {
                                    show : true,
                                    position : 'center',
                                    formatter : '{b}',
                                    textStyle: {
                                        baseline : 'bottom'
                                    }
                                },
                                labelLine : {
                                    show : false
                                }
                            },
                            emphasis: {

                            }
                        }
                    }
                ]
            },
            {
                type : 'pie',
                center : ['58%', '30%'],
                radius : radius,
                x:'45%', // for funnel
                itemStyle : obj.labelFromatter[3],
                data : [
                    {name:'other', value:obj.value_2[3], itemStyle : labelBottom},
                    {
                        name:obj.name[3],
                        value:obj.value_1[3],
                        itemStyle: {
                            normal: {
                                color:color_5[3],
                                label : {
                                    show : true,
                                    position : 'center',
                                    formatter : '{b}',
                                    textStyle: {
                                        baseline : 'bottom'
                                    }
                                },
                                labelLine : {
                                    show : false
                                }
                            },
                            emphasis: {

                            }
                        }
                    }
                ]
            },
            {
                type : 'pie',
                center : ['74%', '30%'],
                radius : radius,
                x:'60%', // for funnel
                itemStyle : obj.labelFromatter[4],
                data : [
                    {name:'other', value:obj.value_2[4], itemStyle : labelBottom},
                    {
                        name:obj.name[4],
                        value:obj.value_1[4],
                        itemStyle: {
                            normal: {
                                color:color_5[4],
                                label : {
                                    show : true,
                                    position : 'center',
                                    formatter : '{b}',
                                    textStyle: {
                                        baseline : 'bottom'
                                    }
                                },
                                labelLine : {
                                    show : false
                                }
                            },
                            emphasis: {

                            }
                        }
                    }
                ]
            },
            {
                type : 'pie',
                center : ['90%', '30%'],
                radius : radius,
                x:'75%', // for funnel
                itemStyle : obj.labelFromatter[5],
                data : [
                    {name:'other', value:obj.value_2[5], itemStyle : labelBottom},
                    {
                        name:obj.name[5],
                        value:obj.value_1[5],
                        itemStyle: {
                            normal: {
                                color:color_5[5],
                                label : {
                                    show : true,
                                    position : 'center',
                                    formatter : '{b}',
                                    textStyle: {
                                        baseline : 'bottom'
                                    }
                                },
                                labelLine : {
                                    show : false
                                }
                            },
                            emphasis: {

                            }
                        }
                    }
                ]
            },
            {
                type : 'pie',
                center : ['18%', '70%'],
                radius : radius,
                y: '55%',   // for funnel
                x: '0%',    // for funnel
                itemStyle : obj.labelFromatter[6],
                data : [
                    {name:'other', value:obj.value_2[6], itemStyle : labelBottom},
                    {
                        name:obj.name[6],
                        value:obj.value_1[6],
                        itemStyle: {
                            normal: {
                                color:color_5[6],
                                label : {
                                    show : true,
                                    position : 'center',
                                    formatter : '{b}',
                                    textStyle: {
                                        baseline : 'bottom'
                                    }
                                },
                                labelLine : {
                                    show : false
                                }
                            },
                            emphasis: {

                            }
                        }
                    }
                ]
            },
            {
                type : 'pie',
                center : ['34%', '70%'],
                radius : radius,
                y: '55%',   // for funnel
                x:'15%',    // for funnel
                itemStyle : obj.labelFromatter[7],
                data : [
                    {name:'other', value:obj.value_2[7], itemStyle : labelBottom},
                    {
                        name:obj.name[7],
                        value:obj.value_1[7],
                        itemStyle: {
                            normal: {
                                color:color_5[7],
                                label : {
                                    show : true,
                                    position : 'center',
                                    formatter : '{b}',
                                    textStyle: {
                                        baseline : 'bottom'
                                    }
                                },
                                labelLine : {
                                    show : false
                                }
                            },
                            emphasis: {

                            }
                        }
                    }
                ]
            },
            {
                type : 'pie',
                center : ['50%', '70%'],
                radius : radius,
                y: '55%',   // for funnel
                x:'30%', // for funnel
                itemStyle : obj.labelFromatter[8],
                data : [
                    {name:'other', value:obj.value_2[8], itemStyle : labelBottom},
                    {
                        name:obj.name[8],
                        value:obj.value_1[8],
                        itemStyle: {
                            normal: {
                                color:color_5[8],
                                label : {
                                    show : true,
                                    position : 'center',
                                    formatter : '{b}',
                                    textStyle: {
                                        baseline : 'bottom'
                                    }
                                },
                                labelLine : {
                                    show : false
                                }
                            },
                            emphasis: {

                            }
                        }
                    }
                ]
            },
            {
                type : 'pie',
                center : ['66%', '70%'],
                radius : radius,
                y: '55%',   // for funnel
                x:'45%', // for funnel
                itemStyle : obj.labelFromatter[9],
                data : [
                    {name:'other', value:obj.value_2[9], itemStyle : labelBottom},
                    {
                        name:obj.name[9],
                        value:obj.value_1[9],
                        itemStyle: {
                            normal: {
                                color:color_5[9],
                                label : {
                                    show : true,
                                    position : 'center',
                                    formatter : '{b}',
                                    textStyle: {
                                        baseline : 'bottom'
                                    }
                                },
                                labelLine : {
                                    show : false
                                }
                            },
                            emphasis: {

                            }
                        }
                    }
                ]
            },
            {
                type : 'pie',
                center : ['82%', '70%'],
                radius : radius,
                y: '55%',   // for funnel
                x:'60%', // for funnel
                itemStyle : obj.labelFromatter[10],
                data : [
                    {name:'other', value:obj.value_2[10], itemStyle : labelBottom},
                    {
                        name:obj.name[10],
                        value:obj.value_1[10],
                        itemStyle: {
                            normal: {
                                color:color_5[10],
                                label : {
                                    show : true,
                                    position : 'center',
                                    formatter : '{b}',
                                    textStyle: {
                                        baseline : 'bottom'
                                    }
                                },
                                labelLine : {
                                    show : false
                                }
                            },
                            emphasis: {

                            }
                        }
                    }
                ]
            }
        ]
    };
    var myChart_4 = echarts.init(document.getElementById('echart_4'));
    myChart_4.clear();
    myChart_4.setOption(option);
    if(firstOrder = 1){
        firstOrder = 2;
        myChart_4.on('click',function(params){
            var flag = false,
                Index = params.seriesIndex;
            if($('#roleEnName').val() == 'sjgly'){
                flag = true;
            }else{
                if($('#orgCode').val().length > 6){
                    if($('#orgCode').val().substring(0,7) == obj.orgCode[Index]){
                        flag = true;
                    }else{
                        Msg('非当前分局无法查看');
                    }
                }else{
                    if($('#orgCode').val() == obj.orgCode[Index]){
                        flag = true;
                    }else{
                        Msg('非当前分局无法查看');
                    }
                }
            }
            if(flag){
                $.ajax({
                    type: 'get',
                    url: baseUrls + 'showPage/orderDetail',
                    data:{
                        orgCode: $('#orgCode').val(),
                        time: defaultTime
                    },
                    beforeSend: function(){
                        Loading();
                    },
                    success: function(response){
                        closeLoading();
                        if(response.responseCode == '1000'){
                            if(response.content.length > 0){
                                var str = '';
                                for(var i = 0; i < response.content.length; i++){
                                    if(response.content[[i]].COMPLETE == 0){
                                        str += '<li class="orderLi"><span class="orderName">【'+ nulls(response.content[i].RECEIVER_NAME) +'】</span><span class="orderContent">'+ nulls(response.content[i].COMNAME) +'</span></li>';
                                    }
                                }
                                layer.open({
                                    title: ['<div class="layer_title">'+params.name+'</div>', 'background:url(/gyxzHTML/showIndex/img/index.png); color:#fff;'],
                                    type: 1,
                                    shadeClose: true,
                                    skin: 'layui-layer-rim', //加上边框
                                    area: ['500px', '500px'], //宽高
                                    scrollbar: false,
                                    move: false,
                                    content: '<ul>'+ str +'</ul>',
                                })
                            }else{
                                Msg('暂无数据');
                            }
                        }else{
                            Msg();
                        }
                    },
                    error:function(){
                        closeLoading();
                    }
                })
            }
        })
    }
}
// echart_5 录入率
// function option_5(obj_5){
//     var colors = ['#0dc884','#0091ea'];
//     Highcharts.getOptions().colors = Highcharts.map(colors, function (color) {
//         return {
//             radialGradient: { cx: 0.5, cy: 1, r: 0.7 },
//             stops: [
//                 [0, color],
//                 [1, Highcharts.Color(color).brighten(-0.25).get('rgb')] // darken
//             ]
//         };
//     });
//     $('#echart_5').highcharts({
//         chart: {
//             type: 'column',
//             backgroundColor:'rgba(23, 83, 93, 0.4)',
//             options3d: {
//                 enabled: true,
//                 alpha: 0,
//                 beta: 0,
//                 viewDistance: 20,
//                 depth: 100
//             },
//             borderWidth: 1,
//             borderColor: 'rgb(0,205,185)',
//             marginBottom: 50,
//             animation: {
//                 duration: 6000
//             }
//             // marginTop: 80,
//             // marginRight: 40
//         },
//         exporting:{
//             enabled: false
//         },
//         title: {
//             text: ''
//         },
//         xAxis: {
//             categories: obj_5.dataName,
//             gridLineWidth: 0,
//             labels: {
//                 formatter: function () {
//                     return this.value
//                 },
//                 style: {
//                     color: 'rgb(0,205,185)',
//                     fontSize:'12px',
//                     fontFamily:'微软雅黑'
//                 }
//             },
//             lineWidth: 1,
//         },
//         yAxis: {
//             allowDecimals: true,
//             gridLineWidth: 0,
//             min: 0,
//             title: {
//                 text: ''
//             },
//             labels: {
//                 formatter: function () {
//                     return this.value
//                 },
//                 style: {
//                     color: 'rgb(0,205,185)',
//                     fontSize:'12px',
//                     fontFamily:'微软雅黑'
//                 }
//             },
//             lineWidth: 1
//         },
//         legend:{
//             align: 'right',
//             verticalAlign: 'top',
//             itemStyle:{
//                 cursor: 'pointer',
//                 color: 'rgb(0,205,185)'
//             },
//             itemHoverStyle:{
//                 color: 'rgb(0,205,185)'
//             },
//             itemHiddenStyle:{
//                 color: 'rgba(0,0,0,.3)'
//             }
//         },
//         tooltip: {
//             headerFormat: '<b>{point.key}</b><br>',
//             pointFormat: '<span style="color:{series.color}">\u25CF</span> {series.name}: {point.y} / {point.stackTotal}'
//         },
//         plotOptions: {
//             column: {
//                 stacking: 'normal',
//                 pointWidth:10,
//                 depth: 0,
//                 dataLabels: {
//                     align: 'center',
//                     enabled: true, // dataLabels设为true
//                     useHTML: true,
//                     style: {
//                         color: 'rgb(0,205,185)',
//                         fontSize: '14px',
//                         fontFamily: '微软雅黑'
//
//                     },
//                     x: 0,
//                     y: 0,
//                     formatter : function () {
//                         return this.y + '%';
//                     }
//                 }
//             }
//         },
//         series: [
//             {
//                 name: '录入率',
//                 // type: 'bar',
//                 data: obj_5.dataValue
//             }
//         ]
//     });
// }
function option_5(obj_5){
    var option = {
        animationDuration: 3000,
        backgroundColor:'rgba(23, 83, 93, 0.4)',

        tooltip : {
            trigger: 'axis',
            show:false
        },
        grid: {
            show:false,
//		    	backgroundColor:'rgba(23, 83, 93, 0.4)',
            top:'10%',
            left: '2%',
            right: '13%',
            bottom: '8%',
            containLabel: true,

        },
        xAxis : [
            {
                type : 'value',
                boundaryGap : [0, 0.1],
                min:0,
                max:100,
                axisLine: {
                    lineStyle: {
                        color: "#b0f3f3"
                    }
                },
                splitLine:{
                    show:false,
                    lineStyle:{
                        color:'rgba(255,255,255,0.2)'
                    }
                }
            }
        ],
        yAxis : [
            {
                type : 'category',
                data : obj_5.dataName,
                axisLine: {
                    lineStyle: {
                        color: "#b0f3f3"
                    }
                },

            }
        ],
        series : [
            {
                name:'录入率',
                type:'bar',
                data:obj_5.dataValue.reverse(),
                barWidth:'10',
                itemStyle:{
                    normal: {
                        barBorderRadius:[0, 10, 10, 0],
                        color: new echarts.graphic.LinearGradient(
                            0, 0, 1, 0,
                            [
                                {offset: 0, color: '#9ac868'},
                                {offset: 1, color: '#04c8b3'}
                            ]
                        ),
                        label : {
                            show: true,
                            position: 'right',
                            formatter : function (params){
                                return params.value + '%'
                            },
                        }
                    },

                }
            }

        ]
    };
    var myChart_5 = echarts.init(document.getElementById('echart_5'));
    myChart_5.clear();
    myChart_5.setOption(option);
}
// echart_6
function option_6(obj_6) {
    Highcharts.getOptions().colors = Highcharts.map(color_1, function (color) {
        return {
            radialGradient: { cx:0, cy: 1,r:2.3 },
            stops: [[0, color], [2, Highcharts.Color(color).brighten(-14).get('rgb')] // darken
            ]
        };
    });
        $('#echart_6').highcharts({
            chart: {
                type: 'column',
                backgroundColor: 'rgba(0,0,0,0)',
                options3d: {
                    enabled: true,
                    alpha: 0,
                    beta: 0,
                    depth: 10,
                    viewDistance: 100,      // 视图距离，它对于计算角度影响在柱图和散列图非常重要。此值不能用于3D的饼图
                    frame: {                // Frame框架，3D图包含柱的面板，我们以X ,Y，Z的坐标系来理解，X轴与 Z轴所形成
                        // 的面为bottom，Y轴与Z轴所形成的面为side，X轴与Y轴所形成的面为back，bottom、
                        // side、back的属性一样，其中size为感官理解的厚度，color为面板颜色
                        bottom: {
                            size: 10,
                            color: 'rgba(0,0,0,0)'
                        },
                        side: {
                            size: 1,
                            color: 'transparent'
                        },
                        back: {
                            size: 1,
                            color: 'transparent'
                        }
                    }
                },
            },
            title: {
                text: ''
            },
            exporting:{
                enabled: false
            },
            subtitle: {
                text: ''
            },
            plotOptions: {
                column: {
                    depth: 25,
                    dataLabels: {
                        align: 'center',
                        enabled: true, // dataLabels设为true
                        useHTML: true,
                        style: {
                            color: 'rgb(0,205,185)',
                            fontSize: '14px',
                            fontFamily: '微软雅黑'

                        },
                        x:0,
                        y: 0
                    }
                }
            },
            legend:{
                align: 'right',
                verticalAlign: 'top',
                itemStyle:{
                    cursor: 'pointer',
                    color: 'rgb(0,205,185)'
                },
                itemHoverStyle:{
                    color: 'rgb(0,205,185)'
                },
                itemHiddenStyle:{
                    color: 'rgba(0,0,0,.3)'
                }
            },
            xAxis: {
                categories: ['云岩分局','乌当分局','经开分局','开阳县分局','修文县分局','观山湖区分局','南明分局','白云分局','花溪分局','息烽县分局','清镇市分局'],
                gridLineWidth: 0,
                lineWidth: 1,
                labels: {
                    formatter: function () {
                        return this.value
                    },
                    style: {
                        color: 'rgb(0,205,185)',
                        fontSize:'12px',
                        fontFamily:'微软雅黑'
                    }
                }
            },
            yAxis: {
                title: {
                    text: null
                },
                gridLineWidth: 0,
                lineWidth: 1,
                labels: {
                    formatter: function () {
                        return this.value
                    },
                    style: {
                        color: 'rgb(0,205,185)',
                        fontSize:'12px',
                        fontFamily:'微软雅黑'
                    }
                }
            },
        series : [
            {
                name:'诈骗案',
                data:obj_6.data5
            },
            {
                name:'抢夺案',
                data:obj_6.data4
            },
            {
                name:'抢劫案',
                data:obj_6.data3
            },
            {
                name:'盗窃案',
                data:obj_6.data2
            },
            {
                name:'放火案',
                stack: '案件八大类',
                data:obj_6.data6
            },
            {
                name:'爆炸案',
                stack: '案件八大类',
                data:obj_6.data7
            },
            {
                name:'劫持案',
                stack: '案件八大类',
                data:obj_6.data8
            },
            {
                name:'杀人案',
                stack: '案件八大类',
                data:obj_6.data9
            },
            {
                name:'伤害案',
                stack: '案件八大类',
                data:obj_6.data10
            },
            {
                name:'强奸案',
                stack: '案件八大类',
                data:obj_6.data11
            },
            {
                name:'绑架案',
                stack: '案件八大类',
                data:obj_6.data12
            }
        ]
        });
}
// function option_6(obj_6){
//     var option = {
//         tooltip : {
//             trigger: 'axis',
//             axisPointer : {            // 坐标轴指示器，坐标轴触发有效
//                 type : 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
//             }
//         },
//         animationDuration: 3000,
//         legend: {
//             data:['诈骗案','抢夺案','抢劫案','盗窃案','放火案','爆炸案','劫持案','杀人案','伤害案','强奸案','绑架案'],
//             textStyle:{
//                 color:'#fff'
//             }
//         },
//
//         calculable : true,
//         xAxis : [
//             {
//                 type : 'category',
//                 data : ['云岩分局','乌当分局','经开分局','开阳县分局','修文县分局','观山湖区分局','南明分局','白云分局','花溪分局','息烽县分局','清镇市分局'],
//                 axisLabel:{
//                     color:'red',
//                     rotate:'45',
//                     interval:'0'
//                 },
//                 axisLine: {
//                     lineStyle: {
//                         color: "#b0f3f3"
//                     }
//                 },
//             }
//         ],
//         yAxis : [
//             {
//                 type : 'value',
//                 axisLine: {
//                     lineStyle: {
//                         color: "#b0f3f3"
//                     }
//                 },
//                 splitLine:{
//                     show:false,
//                     lineStyle:{
//                         color:'rgba(255,255,255,0.3)'
//                     }
//                 }
//             }
//         ],
//         series : [
//             {
//                 name:'诈骗案',
//                 type:'bar',
//                 data:obj_6.data5,
//                 itemStyle:{
//                     normal: {
//                         color: color_5[0],
//                     },
//
//                 }
//             },
//             {
//                 name:'抢夺案',
//                 type:'bar',
//                 data:obj_6.data4,
//                 itemStyle:{
//                     normal: {
//                         color: color_5[1],
//                     },
//
//                 }
//             },
//             {
//                 name:'抢劫案',
//                 type:'bar',
//                 data:obj_6.data3,
//                 itemStyle:{
//                     normal: {
//                         color: color_5[2],
//                     },
//
//                 }
//             },
//             {
//                 name:'盗窃案',
//                 type:'bar',
//                 data:obj_6.data2,
//                 itemStyle:{
//                     normal: {
//                         color: color_5[3],
//                     },
//
//                 }
//             },
//             {
//                 name:'放火案',
//                 type:'bar',
//                 stack: '案件八大类',
//                 data:obj_6.data6,
//                 itemStyle:{
//                     normal: {
//                         color: color_5[4],
//                     },
//
//                 }
//             },
//             {
//                 name:'爆炸案',
//                 type:'bar',
//                 stack: '案件八大类',
//                 data:obj_6.data7,
//                 itemStyle:{
//                     normal: {
//                         color: color_5[5],
//                     },
//
//                 }
//             },
//             {
//                 name:'劫持案',
//                 type:'bar',
//                 stack: '案件八大类',
//                 data:obj_6.data8,
//                 itemStyle:{
//                     normal: {
//                         color:color_5[6],
//                     },
//
//                 }
//             },
//             {
//                 name:'杀人案',
//                 type:'bar',
//                 stack: '案件八大类',
//                 data:obj_6.data9,
//                 itemStyle:{
//                     normal: {
//                         color: color_5[7],
//                     },
//
//                 }
//             },
//             {
//                 name:'伤害案',
//                 type:'bar',
//                 stack: '案件八大类',
//                 data:obj_6.data10,
//                 itemStyle:{
//                     normal: {
//                         color:color_5[8],
//                     },
//
//                 }
//             },
//             {
//                 name:'强奸案',
//                 type:'bar',
//                 stack: '案件八大类',
//                 data:obj_6.data11,
//                 itemStyle:{
//                     normal: {
//                         color:color_5[9],
//                     },
//
//                 }
//             },
//             {
//                 name:'绑架案',
//                 type:'bar',
//                 stack: '案件八大类',
//                 data:obj_6.data12,
//                 itemStyle:{
//                     normal: {
//                         color:'#238c75',
//                     },
//
//                 }
//             }
//         ]
//     };
//     var myChart_6 = echarts.init(document.getElementById('echart_6'));
//     myChart_6.clear();
//     myChart_6.setOption(option);
// }
// 按月统计
function byMonth(item){
    $(item).addClass('onClick').siblings().removeClass('onClick');
    firstCircleLoading = 2;
    $('.resetSpan').show();
    var centerMonth = time().split('-'),
        lastYear = ['01','02','03','04','05','06','07','08','09','10','11','12'],
        nowYear = ['01','02','03','04','05','06','07','08','09','10','11','12'],
        beginTime = (centerMonth[0] - 1) + '-' + lastYear[parseInt(centerMonth[1])] + '-' + centerMonth[2],
        endTime = time(),
        lastMonth = lastYear.slice(lastYear.indexOf(centerMonth[1]) + 1),
        nowMonth = nowYear.slice(0,nowYear.indexOf(centerMonth[1]) + 1),
        x = [];
    lastMonth[0] = (centerMonth[0] - 1) + '-' + lastMonth[0];
    nowMonth[0] = centerMonth[0] + '-' + nowMonth[0];
    if(lastYear.indexOf(centerMonth[1]) >= 11){
        x = nowMonth;
    }else{
        x = lastMonth.concat(nowMonth);
    }

    var concatData = [];
    if(dataCaseEight.length > 0){
        if(dataCase.indexOf('9') >= 0){
            concatData = dataCase.slice(0,dataCase.length -1).concat(dataCaseEight);
        }else{
            concatData = dataCase.concat(dataCaseEight);
        }
    }else{
        concatData = dataCase;
    }
    $.ajax({
        type: 'get',
        url: baseUrls + 'showPage/time',
        data: {
            beginTime: beginTime + ' 00:00:00',
            endTime: endTime + ' 23:59:59',
            time: 2,
            ajlx: concatData.join(',')
        },
        beforeSend: function(){
            if(firstGet == 1){
                Loading();
            }
        },
        success: function(response){
            closeLoading();
            if(response.responseCode == '1000'){
                borkenLineDataMonth(response,x,concatData);
                linkAge(2,concatData,beginTime + ' 00:00:00',endTime + ' 23:59:59');
            }else{
                Msg();
            }
        },
        error: function(){
            closeLoading();
            Msg();
        }
    })
}
//按周统计
function byWeek(item){
    $(item).addClass('onClick').siblings().removeClass('onClick');
    firstCircleLoading = 2;
    $('.resetSpan').show();
    var week = new Date().getDay(),
        getMilliseconds = new Date().getTime(),
        day = new Date(getMilliseconds - week * 60 * 60 * 24 * 1000),
        sunday = getMilliseconds - week * 60 * 60 * 24 * 1000,
        beginTime = day.getFullYear() + '-' + ((day.getMonth() + 1) > 9 ? (day.getMonth() + 1) : '0' + (day.getMonth() + 1)) + '-' + day.getDate(),
        date = [];
    for(var i = 0; i < 7; i++){
        var excessive = new Date(sunday + i * 60 * 60 * 24 * 1000);//过度
        date.push(excessive.getFullYear() + '-' + ((excessive.getMonth() + 1) > 9 ? (excessive.getMonth() + 1) : '0' + (excessive.getMonth() + 1)) + '-' + excessive.getDate());
    }
    var concatData = [];
    if(dataCaseEight.length > 0){
        if(dataCase.indexOf('9') >= 0){
            concatData = dataCase.slice(0,dataCase.length -1).concat(dataCaseEight);
        }else{
            concatData = dataCase.concat(dataCaseEight);
        }
    }else{
        concatData = dataCase;
    }
    $.ajax({
        type: 'get',
        url: baseUrls + 'showPage/time',
        data: {
            beginTime: beginTime + ' 00:00:00',
            endTime: '',
            time: 1,
            ajlx: concatData.join(',')
        },
        beforeSend: function(){
            if(firstGet == 1){
                Loading();
            }
        },
        success: function(response){
            closeLoading();
            if(response.responseCode == '1000'){
                borkenLineDataWeek(response,date,concatData);
                linkAge(1,concatData,beginTime + ' 00:00:00','');
            }else{
                Msg();
            }
        },
        error: function(){
            closeLoading();
            Msg();
        }
    })
}
//按年统计 手动
function byYear(item,e){
    $(item).addClass('onClick').siblings().removeClass('onClick');
    firstCircleLoading = 2;
    $('.resetSpan').show();
    var concatData = [];
    if(dataCaseEight.length > 0){
        if(dataCase.indexOf('9') >= 0){
            concatData = dataCase.slice(0,dataCase.length -1).concat(dataCaseEight);
        }else{
            concatData = dataCase.concat(dataCaseEight);
        }
    }else{
        concatData = dataCase;
    }
    var boxIndex = layer.open({
        type: 4,
        shadeClose: true,
        scrollbar: false,
        content: ['<input id="brokenLine" style="visibility: hidden;"/>', '#byYear'], //数组第二项即吸附元素选择器或者DOM
        success: function(){
            $('.layui-layer.layui-layer-iframe.layui-layer-rim').css({display: 'block'});
            $('.layui-layer-content').css({visibility:'hidden'});
            $('.layui-layer-ico ').css({visibility:'hidden'});
            laydate.render({
                elem: '#brokenLine',
                range: true,
                theme:'molv',
                type: 'year',
                show: true,
                max:time(),
                min: '2011-01-01',
                closeStop: '#byYear',
                done: function(value, date, endDate){
                    dataYear = [];
                    var basis = value.split('-');//当前选中日期
                    if(value.length > 0){
                        dataYear.push($.trim(basis[0]));
                        dataYear.push($.trim(basis[1]));
                        if(dataYear[0] == dataYear[1]){
                            dataYear[0] = (dataYear[0] - 4).toString();
                        }
                    }else{
                        dataYear.push((time().split('-')[0] - 4).toString());
                        dataYear.push(time().split('-')[0]);
                    }
                    layer.close(boxIndex);
                }
            });
        },
        end: function(){
            //年份统计
            $.ajax({
                type: 'get',
                url: baseUrls + 'showPage/time',
                data: {
                    beginTime: dataYear[0] + '-01-01 00:00:00',
                    endTime: dataYear[1] + '-12-31 23:59:59',
                    time: 3,
                    ajlx: concatData.join(',')
                },
                beforeSend: function(){
                    if(firstGet == 1){
                        Loading();
                    }
                },
                success: function(response){
                    closeLoading();
                    if(response.responseCode == '1000'){
                        borkenLineData(response,concatData);
                        linkAge(3,concatData,dataYear[0] + '-01-01 00:00:00',dataYear[1] + '-12-31 23:59:59');
                    }else{
                        Msg();
                    }
                },
                error: function(){
                    closeLoading();
                    Msg();
                }
            })
        }
    });
}
//按年自动
function byYears(item,e){
    $(item).addClass('onClick').siblings().removeClass('onClick');
    var concatData = [],
        beginTime = '',
        endTime = '';
    if(dataCaseEight.length > 0){
        if(dataCase.indexOf('9') >= 0){
            concatData = dataCase.slice(0,dataCase.length -1).concat(dataCaseEight);
        }else{
            concatData = dataCase.concat(dataCaseEight);
        }
    }else{
        concatData = dataCase;
    }
    if(dataYear.length > 0){
        beginTime = dataYear[0] + '-01-01 00:00:00';
        endTime = dataYear[1] + '-12-31 23:59:59';
    }else{
        beginTime = (time().split('-')[0] - 4)+ '-01-01 00:00:00';
        endTime = time().split('-')[0] + '-12-31 23:59:59';
    }
//年份统计
    $.ajax({
        type: 'get',
        url: baseUrls + 'showPage/time',
        data: {
            beginTime: beginTime,
            endTime: endTime,
            time: 3,
            ajlx: concatData.join(',')
        },
        beforeSend: function(){
            if(firstGet == 1){
                Loading();
            }
        },
        success: function(response){
            closeLoading();
            if(response.responseCode == '1000'){
                borkenLineData(response,concatData);
                if(firstCircleLoading != 1){
                    linkAge(3,concatData,beginTime,endTime);
                }
            }else{
                Msg();
            }
        },
        error: function(){
            closeLoading();
            Msg();
        }
    })
}
//案件类型
function caseType(item){
    var chooseType =  $(item).parent().find('.onClick').index();
    var boxIndex = layer.open({
        type: 4,
        shadeClose: true,
        closeBtn: 1,
        scrollbar: false,
        content: ['<div class="twoSelectBox"><div class="selectBoxOne"><select  class="selectpicker selectpickerOne" multiple onchange="getOptions(this,1)"><option value="5">盗窃案</option><option value="6">抢劫案</option><option value="7">抢夺案</option><option value="8">诈骗案</option><option value="9" id="optionId">八类案件</option></select></div><div class="selectBoxTwo"><select class="selectpicker selectpickerTwo" multiple onchange="getOptions(this,2)"><option value="10">放火案</option><option value="11">爆炸案</option><option value="12">劫持案</option><option value="13">杀人案</option><option value="14">伤害案</option><option value="15">强奸案</option><option value="16">绑架案</option></select></div></div>', '#caseType'], //数组第二项即吸附元素选择器或者DOM
        success: function(){
            $('.layui-layer.layui-layer-iframe.layui-layer-rim').css({display: 'block'});
            $('.layui-layer-content').css({width:'320px',height:'220px',background:'transparent'});
            $('.layui-layer-ico ').css({visibility:'hidden'});
            $('.layui-layer-TipsG').css({visibility:'hidden'});
            $('.selectpicker').selectpicker({
                noneSelectedText: '请选择',
                selectAllText: '全选',
                deselectAllText: '取消全选',
                countSelectedText:"已选中{0}项",
                selectedTextFormat:"count > 3",
                actionsBox: true,
                width: '100%'
            });
            $('.selectpickerOne').selectpicker('val',dataCase);
            $('.selectpickerTwo').selectpicker('val',dataCaseEight);
            if(dataCase.indexOf('9') >= 0){
                $('.selectBoxTwo').show();
            }else{
                $('.selectBoxTwo').hide();
            }
        },
        end: function(){
            if(dataYear.length <= 0){
                dataYear.push((time().split('-')[0] - 4).toString());
                dataYear.push(time().split('-')[0]);
            }
            if(chooseType == 0){
                byWeek($('.Tag_click span').eq(0));
            }else if(chooseType == 2){
                byMonth($('.Tag_click span').eq(1));
            }else{
                byYears($('.Tag_click span').eq(2));
            }
        }
    });
};
//饼图详情
function IframeData(response,iframeData){
    //云岩
    response.content.Z520103 ? iframeData.push(response.content.Z520103[0].AMOUNT) : iframeData.push(0);
    //乌当分局
    response.content.Z520112 ? iframeData.push(response.content.Z520112[0].AMOUNT) : iframeData.push(0);
    //经开分局
    response.content.Z520114 ? iframeData.push(response.content.Z520114[0].AMOUNT) : iframeData.push(0);
    //开阳县分局
    response.content.Z520121 ? iframeData.push(response.content.Z520121[0].AMOUNT) : iframeData.push(0);
    //修文县分局
    response.content.Z520123 ? iframeData.push(response.content.Z520123[0].AMOUNT) : iframeData.push(0);
    //观山湖区分局
    response.content.Z520160 ? iframeData.push(response.content.Z520160[0].AMOUNT) : iframeData.push(0);
    //南明分局
    response.content.Z520102 ? iframeData.push(response.content.Z520102[0].AMOUNT) : iframeData.push(0);
    //白云分局
    response.content.Z520113 ? iframeData.push(response.content.Z520113[0].AMOUNT) : iframeData.push(0);
    //花溪分局
    response.content.Z520111 ? iframeData.push(response.content.Z520111[0].AMOUNT) : iframeData.push(0);
    //息烽县分局
    response.content.Z520122 ? iframeData.push(response.content.Z520122[0].AMOUNT) : iframeData.push(0);
    //清镇市分局
    response.content.Z520181 ? iframeData.push(response.content.Z520181[0].AMOUNT) : iframeData.push(0);
}
//年案件类型 数据
function borkenLineData(response,concatData){
    obj_2_year = {
        x: [],
        case_5: [],
        case_6: [],
        case_7: [],
        case_8: [],
        case_9: [],
        case_10: [],
        case_11: [],
        case_12: [],
        case_13: [],
        case_14: [],
        case_15: [],
        case_16: []
    };
    var xData = [];
    if(dataYear.length > 0){
        for(var i = 0; i <= Number(dataYear[1]) - Number(dataYear[0]); i++){
            xData.push(Number(dataYear[0]) + i);
        }
    }else{
        xData.push(time().split('-')[0] - 4);
        xData.push(time().split('-')[0] - 3);
        xData.push(time().split('-')[0] - 2);
        xData.push(time().split('-')[0] - 1);
        xData.push(time().split('-')[0]);
    }
    obj_2_year.x = xData;
    for(var i = 0; i < concatData.length; i++){
        if(response.content['case' + Number(concatData[i])]){
            for(var y = 0; y < xData.length; y++){
                var flag = true;
                for(var z = 0; z < response.content['case' + Number(concatData[i])].length; z++){
                    if(xData[y] == Number(response.content['case' + Number(concatData[i])][z].TIME)){
                        obj_2_year['case_' + Number(concatData[i])].push(response.content['case' + Number(concatData[i])][z].AMOUNT);
                        flag = false;
                        break;
                    }
                }
                if(flag){
                    obj_2_year['case_' + Number(concatData[i])].push(0);
                }
            }
        }else{
            for(var j = 0; j < xData.length; j++){
                obj_2_year['case_' + Number(concatData[i])].push(0);
            }
        }
    }
    option_2(obj_2_year);
}
//月案件类型 数据
function borkenLineDataMonth(response,x,concatData){
    obj_2 = {
        x: Array(12),
        case_5: [],
        case_6: [],
        case_7: [],
        case_8: [],
        case_9: [],
        case_10: [],
        case_11: [],
        case_12: [],
        case_13: [],
        case_14: [],
        case_15: [],
        case_16: []
    }
    for(var i = 0; i < x.length; i++){
        obj_2.x[i] = x[i];
    }
    for(var i = 0; i < concatData.length; i++){
        if(response.content['case' + Number(concatData[i])]){
            for(var y = 0; y < obj_2.x.length; y++){
                var flag = true;
                for(var z = 0; z < response.content['case' + Number(concatData[i])].length; z++){
                    if(Number(obj_2.x[y].substring(obj_2.x[y].length - 2)) == Number(response.content['case' + Number(concatData[i])][z].TIME.substring(response.content['case' + Number(concatData[i])][z].TIME.length - 2))){
                        obj_2['case_' + Number(concatData[i])].push(response.content['case' + Number(concatData[i])][z].AMOUNT);
                        flag = false;
                        break;
                    }
                }
                if(flag){
                    obj_2['case_' + Number(concatData[i])].push(0);
                }
            }
        }else{
            for(var j = 0; j < obj_2.x.length; j++){
                obj_2['case_' + Number(concatData[i])].push(0);
            }
        }
    }
    option_2(obj_2);
}
//周案件类型 数据
function borkenLineDataWeek(response,date,concatData){
    obj_2_week = {  //周
        x: ['周日','周一','周二','周三','周四','周五','周六'],
        case_5: [],
        case_6: [],
        case_7: [],
        case_8: [],
        case_9: [],
        case_10: [],
        case_11: [],
        case_12: [],
        case_13: [],
        case_14: [],
        case_15: [],
        case_16: []
    }
    for(var i = 0; i < concatData.length; i++){
        if(response.content['case' + Number(concatData[i])]){
            for(var y = 0; y < date.length; y++){
                var flag = true;
                for(var z = 0; z < response.content['case' + Number(concatData[i])].length; z++){
                    if(date[y] == response.content['case' + Number(concatData[i])][z].TIME){
                        obj_2_week['case_' + Number(concatData[i])].push(response.content['case' + Number(concatData[i])][z].AMOUNT);
                        flag = false;
                        break;
                    }
                }
                if(flag){
                    obj_2_week['case_' + Number(concatData[i])].push(0);
                }
            }
        }else{
            for(var j = 0; j < date.length; j++){
                obj_2_week['case_' + Number(concatData[i])].push(0);
            }
        }
    }
    option_2(obj_2_week);
}
function getOptions(item,num){
    if(num == 1){//左侧点击
        if(($(item).selectpicker('val').indexOf('9') >= 0 && dataCase.indexOf('9') < 0) || ($(item).selectpicker('val').indexOf('9') >= 0 && dataCaseFlag == true)){
            $('.selectBoxTwo').show();
        }
        if($(item).selectpicker('val').indexOf('9') < 0){
            $('.selectBoxTwo').hide();
        }
        if($(item).selectpicker('val').length > 0){
            dataCase = $(item).selectpicker('val');
            dataCaseFlag = false;
        }else{
            dataCase = ["5", "6", "7", "8", "9"];
            dataCaseFlag = true;
        }
    }else{//右侧点击
        dataCaseEight = $(item).selectpicker('val');
    }
}

//最新案件滚动
function Scroll(){
    var height = $('.updataData').height() / 2;
    newsTime =  setInterval(function(){
        if(initial >= height){
            $('.updataData').css({marginTop: '0px'});
            initial = 0;
        }
        $('.updataData').animate({
            marginTop: '-' + initial + 'px'
        },0)
        initial += 1;
    },50)
}
//联动饼图
function linkAge(item,concatData,beginTime,endTime){
    if(item == 1){
        $('.titleOne').html('全市案发数量统计【周】');
    }
    if(item == 2){
        $('.titleOne').html('全市案发数量统计【月】');
    }
    if(item == 3){
        $('.titleOne').html('全市案发数量统计【年】');
    }
    //联动饼图
    circleBeginTime = beginTime;
    circleEndTime = endTime;
    $.ajax({
        type:'get',
        url: baseUrls + 'showPage/caseCount',
        data: {
            time: item,
            ajlx: concatData.join(','),
            beginTime: beginTime,
            endTime: endTime
        },
        // beforeSend: function(){
        //     Loading();
        // },
        success:function(data){
            closeLoading();
            if(data.responseCode == '1000'){
                //caseCountByType-全市案件统计
                if(data.content.caseCountByType.length > 0){
                    dataOneCode = [];
                    dataOne = [];
                    for(var i=0;i<data.content.caseCountByType.length;i++){
                        if(data.content.caseCountByType[i].CODE != '0'){
                            dataOneCode.push(data.content.caseCountByType[i].CODE);
                            dataOne.push(
                                [data.content.caseCountByType[i].NAME + '(' + nulls(data.content.caseCountByType[i].AMOUNT) + ')',Number(data.content.caseCountByType[i].AMOUNT)]
                            )
                        }

                    }
                    option_1(dataOne);
                }
            }else{
                Msg();
            }
        },
        error:function(){
            closeLoading();
            Msg();
        }
    });
}
//鼠标经过
function moveIn(item){
    tips = layer.tips($(item).html(), '#' + $(item).attr('id'), {tips: [1, '#0b1c25'], time: 100000000});
    clearInterval(newsTime);
    newsTime = null;
}
function moveOut(item){
    layer.close(tips);
    Scroll();
}
function statisTab(item){
    defaultTime = $(item).index() + 1;
    main_data();
    admissionRate();
    //折线图
    if(defaultTime == 1){
        byWeek($('.Tag_click span').eq(0));
        $('.titleOne').html('全市案发数量统计【周】');
        $('.titleTwo').html('全市录入情况【周】');
        $('.titleThree').html('工作指令完成情况【周】');
        $('.titleFour').html('录入率【周】');
    }
    if(defaultTime == 2){
        byMonth($('.Tag_click span').eq(1));
        $('.titleOne').html('全市案发数量统计【月】');
        $('.titleTwo').html('全市录入情况【月】');
        $('.titleThree').html('工作指令完成情况【月】');
        $('.titleFour').html('录入率【月】');
    }
    if(defaultTime == 3){
        byYears($('.Tag_click span').eq(2));
        $('.titleOne').html('全市案发数量统计【年】');
        $('.titleTwo').html('全市录入情况【年】');
        $('.titleThree').html('工作指令完成情况【年】');
        $('.titleFour').html('录入率【年】');
    }
}
//饼图重置
function resetCircle(event){
//取消事件冒泡
    var e = arguments.callee.caller.arguments[0]|| event; //若省略此句，下面的e改为event，IE运行可以，但是其他浏览器就不兼容
    if (e && e.stopPropagation) {
        // this code is for Mozilla and Opera
        e.stopPropagation();
    } else if (window.event) {
        // this code is for IE
        window.event.cancelBubble = true;
    }
    firstCircleLoading = 1;
    circleEndTime = '';
    circleBeginTime = '';
    $('.titleOne').html('全市案发数量统计【年】');
    $('.resetSpan').hide();
    $.ajax({
        type:'get',
        url: baseUrls + 'showPage/caseCount',
        data:{
            time: defaultTime,
            ajlx: ''
        },
        beforeSend: function(){
            if(firstGet == 1){
                Loading();
            }
        },
        success:function(data){
            closeLoading();
            if(data.responseCode == '1000'){
                //caseCountByType-全市案件统计
                if(data.content.caseCountByType.length > 0){
                    dataOneCode = [];
                    dataOne = [];
                    for(var i=0;i<data.content.caseCountByType.length;i++){
                        if(data.content.caseCountByType[i].CODE != '0'){
                            dataOneCode.push(data.content.caseCountByType[i].CODE);
                            dataOne.push(
                                [data.content.caseCountByType[i].NAME + '(' + nulls(data.content.caseCountByType[i].AMOUNT) + ')',Number(data.content.caseCountByType[i].AMOUNT)]
                            )
                        }

                    }
                    option_1(dataOne);
                }
            }else{
                Msg();
            }
        },
        error: function(){
            closeLoading();
        }
    })
}
function showDetail(uniq){
    layer.open({
        type: 2,
        area: ['90%', $(window).height() * 0.9 + 'px'],
        fixed: false, //不固定
        maxmin: false,
        content: 'layer/layer.html?' + uniq + '&' + $('#userId').val(),
        cancel: function(){
        }
    });
}